export const CHANG_TRANSLATION_LIST = 'CHANG_TRANSLATION_LIST'

const changeTranslationListAction = list => ({
  type: CHANG_TRANSLATION_LIST,
  list
})

export const getTranslationList = () => {
  return (dispatch, getState, axiosInstance) => {
    return axiosInstance
      .get('/api/translations.json')
      .then(res => {
        if (res.data.success) {
          const list = res.data.data
          dispatch(changeTranslationListAction(list))
        }
      })
  }
}
